import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useRouteStateStore = defineStore(
  'routeState',
  () => {
    const detailId = ref('')
    const setDetailId = (id: string) => {
      detailId.value = id
    }
    const getDetailId = (): string => {
      return detailId.value
    }
    const delDetailId = () => {
      detailId.value = ''
    }
    return {
      setDetailId,
      getDetailId,
      delDetailId,
    }
  },
  {
    persist: true,
  },
)
